package com.mall.xiaomi.controller;

import com.mall.xiaomi.pojo.ProductPicture;
import com.mall.xiaomi.service.ProductPictrueService;
import com.mall.xiaomi.util.ResultMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author XueWanglin
 * @ClassName ProductPictureController
 * @Description TODO
 * @Date 2021/2/26 11:00
 * @Version 1.0
 */
@RestController
@RequestMapping("/productPicture")
public class    ProductPictureController {
    @Autowired
    private ProductPictrueService productPictrueService;
    @Autowired
    private ResultMessage resultMessage;

    @GetMapping("product/{productId}")
    public ResultMessage getProductPictureByProductId(@PathVariable Integer productId){
        List<ProductPicture> list = productPictrueService.selectPicturesByProductId(productId);
        resultMessage.success("001",list);
        return resultMessage;
    }
}
